<div class="da-list-wrap">


<div class="da-content-banner">
  <d-breadcrumb>
    <d-breadcrumb-item><a routerLink="/">{{ 'device.breadcrumb.home' | translate }}</a></d-breadcrumb-item>
    <d-breadcrumb-item><a routerLink="/pages/device/device">{{ 'device.breadcrumb.device' | translate }}</a></d-breadcrumb-item>
    <d-breadcrumb-item>{{ 'device.breadcrumb.addDvice' | translate }}</d-breadcrumb-item>
  </d-breadcrumb>
</div>
<div class="da-content-wrapper">



          <div class="card">
            <div class="card-title">
              <p class="form-title">更新设备</p>
            </div>
            <form dForm ngForm [layout]="layoutDirection" [labelSize]="'sm'"[labelAlign]="'end'" class="mt-5" (dSubmit)="submit()">
              <div class="form-body">

                <div class="grid mt-3">
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label"><span class="Required">*</span>设备编码</span>
                      </d-form-label>
                      <d-form-control>
                        <input dTextInput class="form-input-box" name="code" [(ngModel)]="this.device.equipmentNum" disabled>
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label"><span class="Required">*</span>设备名称</span>
                      </d-form-label>
                      <d-form-control>
                        <input dTextInput class="form-input-box" name="name" [(ngModel)]="this.device.equipmentName">
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">型号</span>
                      </d-form-label>
                      <d-form-control>
                        <input dTextInput class="form-input-box" name="model" [(ngModel)]="this.device.model">
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">品牌</span>
                      </d-form-label>
                      <d-form-control>
                        <input dTextInput class="form-input-box" name="Brand" >
                      </d-form-control>
                    </d-form-item>
                  </div>

                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label"><span class="Required">*</span>设备类别</span>
                      </d-form-label>
                      <d-form-control>
                        <d-cascader
                          [options]="options"
                          [trigger]="'hover'"
                          [showPath]="true"
                          [allowClear]="true"
                          [dropdownWidth]="130"
                          name="deviceClassCode"
                          (ngModelChange)="CascaderonChanges($event)"
                          [(ngModel)]="this.option"
                      ></d-cascader>
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">场地</span>
                      </d-form-label>
                      <d-form-control>
                        <input dTextInput class="form-input-box" name="Brand" [(ngModel)]="this.device.site">
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">购买时间</span>
                      </d-form-label>
                      <d-form-control>
                        <d-datepicker-pro  [appendToBody]="false"
                        name="purchaseDate"

                        [(ngModel)]="this.purchaseDate"
                        (ngModelChange)="purchaseDateChange()"

                        ></d-datepicker-pro>
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">出厂日期</span>
                      </d-form-label>
                      <d-form-control>
                        <d-datepicker-pro  [appendToBody]="false"
                        name="productionDate"
                        [(ngModel)]="this.productionDate"
                        (ngModelChange)="productionDateChange()"
                        ></d-datepicker-pro>
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">资产编码</span>
                      </d-form-label>
                      <d-form-control>
                        <input dTextInput class="form-input-box" name="zichan" [(ngModel)]="device.assetsCode">
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">安装时间</span>
                      </d-form-label>
                      <d-form-control>
                        <d-datepicker-pro  [appendToBody]="false"
                        name="assemblyTime"
                        [(ngModel)]="this.assemblyTime"
                        (ngModelChange)="assemblyTimeChange()"
                        ></d-datepicker-pro>
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">工作状态</span>
                      </d-form-label>
                      <d-form-control>
                        <d-radio-group
                          [name]="'status'"
                          [values]="status"
                          [direction]="'row'"
                          [(ngModel)]="chosenItem"
                          (ngModelChange)="statusChange()"
                        ></d-radio-group>
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">设备级别</span>
                      </d-form-label>
                      <d-form-control>
                        <d-select [options]="deviceLevel" name="deviceLevel"  [(ngModel)]="device.level">
                        </d-select>
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">可排产</span>
                      </d-form-label>
                      <d-form-control>
                        <d-toggle [checked]="true"
                          name="isScheduling"
                        [(ngModel)]="device.isScheduling"></d-toggle>
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">车间</span>
                      </d-form-label>
                      <d-form-control>
                        <d-select [options]="" [valueKey]="'value'" [filterKey]="'label'" name="workshop"  [(ngModel)]="device.workshop">
                        </d-select>
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">保养项目</span>
                      </d-form-label>
                      <d-form-control>
                        <d-select [options]="" [valueKey]="'value'" [filterKey]="'label'" name="maintenanceTypeId"  [(ngModel)]="device.maintenanceTypeId">
                        </d-select>
                      </d-form-control>
                    </d-form-item>
                  </div>
                  <div class="u-1-2">
                    <d-form-item>
                      <d-form-label>
                        <span class="label">排序</span>
                      </d-form-label>
                      <d-form-control>
                        <d-input-number  class="input-number"    [allowEmpty]="true"
                        name="priority"
                        [(ngModel)]="device.priority"></d-input-number>
                      </d-form-control>
                    </d-form-item>
                  </div>
                </div>
              </div>
              <d-form-operation>
                <d-button bsStyle="primary" dFormSubmit >确定</d-button>
                <d-button class="ms-3" bsStyle="common" (btnClick)="cancle()">取消</d-button>
              </d-form-operation>
            </form>
          </div>


</div>
</div>
<d-toast [value]="msgs" [life]="2000" [styleClass]="'custom-class'" [style]="{ left: '50%',top:'10px' }"></d-toast>
